<?php
//订单列表的遍历展示
	include_once("./com.php");
	$sql="select ord.*,ad.t_name,ad.t_add from ts_order ord,ts_address ad where ord.addr_id=ad.addr_id";
	$der = mysql_query($sql);
	 $order=[];
	while($res=mysql_fetch_assoc($der)){
    $order[]=$res;
}

 ?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>商品管理</title>
<base target="_self">
<link rel="stylesheet" type="text/css" href="skin/css/base.css" />
<link rel="stylesheet" type="text/css" href="skin/css/main.css" />
</head>
<body leftmargin="8" topmargin='8'>
<table width="98%" align="center" border="0" cellpadding="3" cellspacing="1" bgcolor="#CBD8AC" style="margin-bottom:8px;margin-top:8px;">
  <tr>
    <td background="skin/images/frame/wbg.gif" bgcolor="#EEF4EA" class='title' colspan="2"><span><img src='skin/images/frame/arr3.gif' style='margin-right:10px;'>订单列表</span></td>
  </tr>
  <tr bgcolor="#FFFFFF">
       <td colspan="2">
            <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CFCFCF" align="center" style="margin-top:8px">
            <tr align="center" bgcolor="#FBFCE2" height="25">
                <th width="3%">编号</th>
                <th width="10%">收货地址</th>
                <th width="10%">收货人</th>
                <th width="10%">总价</th>
                <th width="10%">支付状态</th>
                <th width="10%">发货状态</th>
                <th width="10%">订单时间</th>
                <th width="10%">订单号</th>
            </tr>
            <?php foreach ($order as $value){ ?>            	      
            <tr align='center' bgcolor="#FFFFFF" height="26" align="center" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';">
                <td><?= $value['order_id'] ?></td>
                <td><?= $value['t_add'] ?></td>
                <td><?= $value['t_name'] ?></td>
                <td><?= $value['subtotal'] ?></td>
                 <td>
                 <?php if($value['pay_status']==0) {?>
                 		   未支付
                 <?php	}elseif($value['pay_status']==1){ ?>
                 		   已支付                             
                 <?php } ?>               
               </td>
               <td>
                
               <?php if($value['delivery_status']==0){ ?>
						    <a href="order_edit.php?order_id=<?= $value['order_id'] ?>&type=1">是否发货？</a>
				       <?php }elseif($value['delivery_status']==1){ ?>
                 		 发货
              <?php }elseif($value['delivery_status']==2) { ?>
                     已收货 
              <?php } ?>
              
               </td>
                <td><?= $value['order_time'] ?></td>
                <td><?= $value['order_sn'] ?></td>
                
            </tr>
          <?php } ?>
        </table>
    </td>
  </tr>
  </tr>
</table>
</body>
</html>